home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
invest.dir
/
00250_Script_Inv Induced Obj
< prev
next >
Wrap
Text File
|
1997-05-26
|
6KB
|
182 lines
--Inv Induced Obj
property pPuppetSpriteList, pStartMagnetSprite, pMovingMagnetSprite, pStartMagnetCastNum
property pMotorPos, pLastmovienum, pMagnet, pSliderPos, pFlag, pTempx
property pDirection, pMotorCount, pQTStartCast, pCoilStartCast
property pBottomCoilSpriteNum, pTopCoilSpriteNum
property pInvisibleMagnet
-----------------------------------------------------ò
on mInit me
set pPuppetSpriteList = [3,4,5,13,14,15]
set pStartMagnetSprite = 10
set pMovingMagnetSprite = 4
set pStartMagnetCastNum = the number of cast "Large Mag. W.Bar"
set pQTStartCast = the number of cast "temp movie"
set pCoilStartCast = the number of cast "#2 Back"
set pBottomCoilSpriteNum = 3
set pTopCoilSpriteNum = 5
mActivate (me)
return me
end mInit
-----------------------------------------------------ò
on mActivate me
repeat with x in pPuppetSpriteList
puppetSprite x, true
end repeat
set pMagnet = 1
set pSliderPos = 1
set pMotorPos = 0
set pLastmovienum = 0
-- set initial position of magnet and rod
mUpdateLoops(me)
set initPos = 245
set pMotorCount = 1
set pDirection = 1
set pTempx = 327
set pInvisibleMagnet = 12
set the visible of sprite 12 = 0
set pFlag = 0
end mActivate
-----------------------------------------------------ò
on mClose me
repeat with x in pPuppetSpriteList
puppetSprite x, false
end repeat
--tj&dl
repeat with n = 2 to 20
set the puppet of sprite n = 0
set the visible of sprite n = 1
end repeat
puppetsprite 33, false
end mClose
-----------------------------------------------------ò
on mFlagSet me
set pFlag = 1
end mFlagSet
-----------------------------------------------------ò
on mFrameLoop me
-- set animation step size
set stepsize = 3
if pMotorPos<>0 then
set movienum = (pSliderPos-1)*9+(pMagnet-1)*3+pMotorPos
if movienum <> pLastmovienum then
set the loch of sprite 4 to 210
set pLastmovienum = movienum
set the castnum of sprite 13 to pQTStartCast + movienum
if the castNum of sprite 13 < pQTStartCast then
put pMotorPos && pMagnet && pSliderPos && pFlag && pTempx
set the castNum of sprite 13 = pQTStartCast
end if
end if
if pFlag = 0 then
set pMotorCount = pMotorCount + 1
set delta = pMotorPos*stepsize
set pTempx = the loch of sprite 4
-- check to see if the motor is at the end, if so, switch pDirection
if pTempx + delta > 240 then -- 255 then
set pDirection = -1
end if
if pTempx - delta < 210 then
set pDirection = 1
set pMotorCount = 0
end if
set the loch of sprite 4 to pTempx+delta*pDirection
set the movietime of sprite 13 to ( (the movietime of sprite 13) + 4 )
updateStage
end if
end if
-- bugs here
--if the movierate of sprite 13 = 0 then set the movietime of sprite 13 = 1
go the frame
end mFrameLoop
-----------------------------------------------------ò
on mSelectMagnet me
set ClickIndex = the clickon - pStartMagnetSprite
set the visible of sprite pInvisibleMagnet = 1
set pInvisibleMagnet = the clickOn
set the visible of sprite pInvisibleMagnet = 0
set the castnum of sprite pMovingMagnetSprite = pStartMagnetCastNum + ClickIndex
set pMagnet = 3 - ClickIndex
end mSelectMagnet
-----------------------------------------------------ò
on mLoopSliderClick me
repeat while the mousedown
set pTempx = the mouseH
if pTempx < 456 then
set pTempx = 456
end if
if pTempx > 566 then
set pTempx = 566
end if
set the loch of sprite 15 to pTempx
updateStage
end repeat
set pSliderPos = 1+(13+pTempx-456)/27
if pSliderPos < 0 then set pSliderPos = 1
set CheckSum = (27*(pSliderPos-1)+456)
if CheckSum < 456 then set CheckSum = 456
set the loch of sprite 15 to CheckSum
updateStage
mUpdateLoops(me)
end mLoopSliderClick
-----------------------------------------------------ò
on mSpeedSliderClick me
repeat while the mousedown
set pTempx = the mouseH
if pTempx > 305 then set pTempx = 305
if pTempx < 219 then set pTempx = 219
set the loch of sprite 14 to pTempx
updateStage
end repeat
set pMotorPos = (14+pTempx-219)/28
if pMotorPos = 0 then set pFlag = 1
else set pFlag = 0
set the loch of sprite 14 to (28*(pMotorPos)+219)
set CheckSum = (28*(pMotorPos)+219)
if CheckSum < 219 then set the locH of sprite 14 = 219
updateStage
end mSpeedSliderClick
-----------------------------------------------------ò
on mUpdateLoops me
--put "pSliderPos" && pSliderPos
set the castnum of sprite pBottomCoilSpriteNum to (pCoilStartCast - 2) + pSliderPos*2
if the castNum of sprite pBottomCoilSpriteNum < pCoilStartCast then set the castNum of sprite pBottomCoilSpriteNum = pCoilStartCast
set the castnum of sprite pTopCoilSpriteNum to (pCoilStartCast - 1) + pSliderPos*2
if the castNum of sprite pTopCoilSpriteNum < (pCoilStartCast + 1) then set the castNum of sprite pBottomCoilSpriteNum = pCoilStartCast + 1
updateStage
end mUpdateLoops
-----------------------------------------------------ò
-----------------------------------------------------ò
-----------------------------------------------------ò
-----------------------------------------------------ò